package thread.thread_04_19.test_join;

import java.util.concurrent.TimeUnit;

/**
 * @author bruin_du
 * @description 使用join
 * @date 2022/5/2 17:21
 **/
class Account extends Thread{
    @Override
    public void run() {
        try {
            TimeUnit.SECONDS.sleep(5);
            System.out.println("张三转账成功");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

public class Main {
    public static void main(String[] args) throws InterruptedException {
        Account t = new Account();
        t.start();

        t.join();
        System.out.println("李四存钱");
    }
}
